# -*- mode: snippet -*-
# name: sqlalchemy
# key: sqlalchemy
# --
from sqlalchemy import *;       # column,integer,string
from sqlalchemy.orm import *
from sqlalchemy.ext.declarative import declarative_base
# engine = create_engine('sqlite:///./sqlalchemy.db', echo=True);

engine = create_engine('mysql+pymysql://localhost/test');
metadata = MetaData(engine)
Session = sessionmaker(bind=engine)
session = Session()


Base = declarative_base()

class User(Base):
    __tablename__ = 'users1'
    id = Column(Integer, Sequence('user_id_seq'), primary_key=True)
    name = Column(String(50))
    fullname = Column(String(50))
    password = Column(String(12))

    def __repr__(self):
        return "<User(name='%s', fullname='%s', password='%s')>" % (
                                self.name, self.fullname, self.password)
